﻿#region Header
//
//   Project:           PicFx - Windows Phone 7 image effects app.
//
//   Changed by:        $Author$
//   Changed on:        $Date$
//   Changed in:        $Revision$
//   Project:           $URL$
//   Id:                $Id$
//
//
//   Copyright (c) 2010 Rene Schulte
//
//   This program is open source software. Please read the License.txt.
//
#endregion

using System.Windows.Media;
using System.Windows.Media.Imaging;
using PicFx.Effects;

namespace PicFx.ViewModels
{
   /// <summary>
   /// A generic effect item.
   /// </summary>
   public class EffectItem
   {
      public IEffect Effect { get; private set; }
      public string Name { get; private set; }
      public ImageSource Thumbnail { get; set; }

      public EffectItem(IEffect effect)
      {
         Effect = effect;
         Name = effect.Name;
      }

      public EffectItem(IEffect effect, string thumbnailRelativeResourcePath)
         : this(effect)
      {
         // Load the thumbnail from the resource stream using the WriteableBitmapEx lib
         Thumbnail = new WriteableBitmap(0, 0).FromResource(thumbnailRelativeResourcePath);
      }

      public EffectItem(IEffect effect, string thumbnailRelativeResourcePath, string name)
         : this(effect, thumbnailRelativeResourcePath)
      {
         Name = name;
      }
   }
}
